{template 'header'}
<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">会员管理</a>
        <a>
          <cite>升级订单</cite></a>
      </span>
  <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
     href="javascript:location.replace(location.href);" title="刷新">
    <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
  <div class="layui-row">
    <form class="layui-form layui-col-md12 x-so" id="search">
      <input type="text" name="keyword" placeholder="会员ID/手机号/真实姓名" autocomplete="off" class="layui-input" id="keyword"
             value="{$keyword}">
      <input class="layui-input" autocomplete="off" placeholder="支付开始日" name="start_time" id="start_time"
             value="{$_GPC['start_time']}">
      <input class="layui-input" autocomplete="off" placeholder="支付截止日" name="end_time" id="end_time"
             value="{$_GPC['end_time']}">
      <input type="text" name="order_sn" placeholder="请输入订单编号" autocomplete="off" class="layui-input" id="order_sn"
             value="{$order_sn}">
      <div class="layui-input-inline">
        <select name="paytype">
          <option value="" {if $paytype==''}selected{/if}>支付方式</option>
          <option value="1" {if $paytype==1}selected{/if}>微信</option>
          <option value="2" {if $paytype==2}selected{/if}>支付宝</option>
        </select>
      </div>
      <div class="layui-input-inline">
        <select name="is_true">
          <option value="" {if $is_true==''}selected{/if}>支付状态</option>
          <option value="1" {if $is_true==1}selected{/if}>已支付</option>
          <option value="2" {if $is_true==2}selected{/if}>未支付</option>
        </select>
      </div>
      <button class="layui-btn" lay-submit="" lay-filter="search"><i class="layui-icon">&#xe615;</i></button>
      <span class="x-right" style="line-height:40px">共有数据：{$total} 条</span>
    </form>
  </div>

  <table class="layui-table x-admin">
    <thead>
    <tr>
        <th>
          <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i
                  class="layui-icon">&#xe605;</i></div>
        </th>
        <th>ID</th>
        <th>订单编号</th>
        <th>用户信息</th>
        <th>升级类型</th>
        <th>支付方式</th>
        <th>支付金额</th>
        <th>支付时间</th>
        <th>支付状态</th>
        <th>下单时间</th>
    </tr>
    </thead>
      <tbody>
      {if $total==0}

      <tr>
        <td colspan="11" style="text-align: center;">暂无数据</td>
      </tr>

      {else}
      {loop $list $item}
        <tr>
          <td>
            <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='{$item["id"]}'><i
                    class="layui-icon">&#xe605;</i></div>
          </td>
          <td>{$item["id"]}</td>
          <td>{$item["order_sn"]}</td>
          <td>用户编号:{$item["user_id"]}<br>手机号:{$item['mobile']}</td>
          <td>
            {if $item['paytype'] == '1'}
            <span>微信</span>
            {elseif $item['paytype'] == '2'}
            <span>支付宝</span>
            {/if}
          </td>
          <td>{$item["payprice"]}</td>
          <td>
            {if $item['upgrade_type'] == '1'}
            <b style="color: red">VIP会员</b>
            {/if}
          </td>
          <td>{php echo date('Y-m-d H:i:s',$item["paytime"])}</td>
          <td>
            {if $item['is_true'] == '1'}
            <span>已支付</span>
            {elseif $item['is_true'] == '2'}
            <span>未支付</span>
            {/if}
          </td>
          <td>{php echo date('Y-m-d H:i:s',$item["create_time"])}</td>
        </tr>
      {/loop}
      {/if}
      </tbody>
    </table>
  <div class="page">
      {$pager}
  </div>

</div>
<script>
    layui.use('form', function () {
      var form = layui.form;

      //监听提交
      form.on('submit(search)', function (data) {
        console.log(data.field)
        var str = '';
        for (var key in data.field) {
          str += key + "=" + data.field[key] + "&";
        }
        var url = '{php echo $this->createWebUrl("member_upgrade_list")}'
        location.href = url + "&" + str;
        return false;
      });
    });

    function exportUser(){
      var str = $('#search').serialize();
      var ids = tableCheck.getData();
      var url = '{php echo $this->createWebUrl("member_upgrade_export")}'
      location.href = url + "&" + str + "&ids=" + ids;
    }

    layui.use('laydate', function () {
      var laydate = layui.laydate;

      //执行一个laydate实例
      laydate.render({
        elem: '#start_time', //指定元素
        type: 'datetime'
      });

      //执行一个laydate实例
      laydate.render({
        elem: '#end_time', //指定元素
        type: 'datetime'
      });
    });

</script>
<script>var _hmt = _hmt || []; (function() {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
  })();</script>
</body>

</html>